package com.mt.feign;

import com.mt.constants.Result;
import com.mt.pojo.CommentLike;
import com.mt.pojo.Film;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @author Wang
 * @Description
 * @date 2020/12/3-11:59
 */

@Component
@FeignClient(value = "mt-film")
//@FeignClient(value = "http://localhost:8081")
public interface FilmApiProvider {

    @GetMapping("/film/topfilms")
    Result getTopFilm();

    @PostMapping("/like/save")
    boolean saveLikeList2Db(List<CommentLike> list);

    @PostMapping("/like/countTotal")
    boolean countLikeTotal(Map<Integer, Integer> likeMap);

    @GetMapping("/film/list")
    Result getFilmList(@RequestParam("ids") List <Integer> ids);
}
